package org.jeecg.modules.factor.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.api.entity.CyHouseGas;
import org.jeecg.modules.factor.mapper.CyHouseGasMapper;
import org.jeecg.modules.factor.service.ICyHouseGasService;
import org.jeecg.modules.api.entity.CyGasStore;
import org.jeecg.modules.gas.mapper.CyGasStoreMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 温室气体
 * @Author: jeecg-boot
 * @Date:   2024-11-04
 * @Version: V1.0
 */
@Service
public class CyHouseGasServiceImpl extends ServiceImpl<CyHouseGasMapper, CyHouseGas> implements ICyHouseGasService {

    @Autowired
    private  CyHouseGasMapper cyHouseGasMapper;
    @Autowired
    private CyGasStoreMapper cyGasStoreMapper;


    @Override
    public List<CyHouseGas> getGasList(String emissionFactorId) {
        //根据碳排因子id查询出其中包含的所有气体配比
        List<CyHouseGas> gasList = cyHouseGasMapper.getGasList(emissionFactorId);
        return gasList;
    }

    @Override
    public List<CyHouseGas> batchGetGasRatio(List<String> EmissionFactorIdList) {

        List<CyHouseGas> gasRatioList = cyHouseGasMapper.batchGetGasRatio(EmissionFactorIdList);
        return gasRatioList;
    }

    @Override
    public void deleteByEmissionFactorId(String emissionFactorId) {
        cyHouseGasMapper.deleteByEmissionFactorId(emissionFactorId);
    }

    @Override
    public List<CyGasStore> batchGetAllGasStore() {
        List<CyGasStore> res = cyGasStoreMapper.batchGetAllGasStore();
        return res;
    }
}
